package com.study.example.demo04;

import com.study.example.demo03.Demo03Service;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: likai
 * @Date: 2021/5/19 10:33
 * @Description:  spring 4.x版本特点.添加注解@Condition注解,替换掉applicationContext.xml
 */
@Configuration//等价于 applicationContext.xml
public class SpringCondition  {

    @Bean
    @Conditional(GPCondition.class)
    public Demo03Service getuser(){
        return new Demo03Service();
    }
}
